package interfacedemo;

public class Demo {
    public static void main(String[] args) {
        //Dog d = new Dog();
        method01(new Dog());//method01(0x7C)

        System.out.println("------------");

        Swim swim = method02();//Swim swim=new Dog();//父接口指向子类对象
        swim.swimming();
    }

    public static void  method01(Swim s) {//Swim s=new Dog();//父接口指向子类对象
        s.swimming();
    }
    public static Swim method02() {
       /* Dog dog = new Dog();//Dog dog=0x5B
        return dog;//return 0x5B*/
       return new Dog();
    }
}
